<template src="./index.html"></template>
<script>
export default {
  name: "home",
  data() {
    return {
      name: "按钮",
    };
  },
  created() {
    console.log(this.$http);
    //本地存储
    let theme = !localStorage.getItem("theme")
      ? ""
      : localStorage.getItem("theme");
    if (theme) {
      window.document.documentElement.setAttribute("data-theme", theme);
    }else{
      window.document.documentElement.setAttribute("data-theme", 'light');
    }
  },
  methods: {
    changColor(theme) {
      window.document.documentElement.setAttribute("data-theme", theme);
      localStorage.setItem("theme", theme);
    },
  },
};
</script>
<style src="./index.scss" scoped lang="scss"></style>
